echo "usage"
echo "install.sh gitusername email_address"
mv /etc/apt/sources.list  /etc/apt/sources.list.bak
echo "deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse" > /etc/apt/sources.list
apt-get update
apt-get install -y git python3.6 postgresql nano \
virtualenv xz-utils wget fontconfig libfreetype6 libx11-6 \
libxext6 libxrender1 xfonts-75dpi
git clone https://gitee.com/duanchenyuan/wkhtmltopdf.git
cd wkhtmltopdf
unzip wkhtmltox_0.12.5-1.bionic_amd64.zip.001
cd wkhtmltox_0.12.5-1.bionic_amd64
dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
apt-get -fy install
cd ../../
rm -rf wkhtmltopdf
apt-get install -y gcc python3.6-dev libxml2-dev \
libxslt1-dev libevent-dev libsasl2-dev libssl1.0-dev libldap2-dev \
libpq-dev libpng-dev libjpeg-dev
sudo -u postgres createuser --createdb `whoami`
createdb `whoami`
git config --global user.name $1
git config --global user.email $2
mkdir ~/odoo-dev
cd ~/odoo-dev
git clone -b 13.0 --depth 1 --single-branch https://gitee.com/mirrors/odoo.git
cd odoo
virtualenv -p python3 ~/odoo-13.0
source ~/odoo-12.0/bin/activate
pip3 install -r requirements.txt
createdb odoo-test
python3 odoo-bin -d odoo-test --addons-path=addons \
--db-filter=odoo-test$ -i base

echo "python3 odoo-bin -d odoo-test --addons-path=addons --db-filter=odoo-test$ & "